package work.zhengyun.demo.configuration;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 文件上传下载相关配置
 *
 * @author zhengyun
 * @date 2019/11/26 10:45
 */
@Component
public class FileServiceConfig {

    /**
     * 上传路径
     */
    @Value("${file.profile}")
    public static String profile;



    public static String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    // 获取上传头像路径
    public static String getAvatarPath() {
        return profile + "avatar/";
    }

    // 获取下载路径
    public static String getDownloadPath() {
        return profile + "download/";
    }

    // 获取上传路径
    public static String getUploadPath() {
        return profile + "upload/";
    }

}
